<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>上传文件</title>
    <link rel="stylesheet" type="text/css" href="${request.contextPath}/bootstrap/5.1.3/css/bootstrap.css"/>
    <script type="text/javascript" src="${request.contextPath}/bootstrap/5.1.3/js/bootstrap.bundle.js"></script>
</head>
<body>
<div class="container-fluid">
    <#if message?? && isSuccess??>
        <div class="alert <#if isSuccess=='true'>alert-success<#else>alert-danger</#if>" role="alert" style="position: fixed;width: 500px;left: 0;right: 0;margin: 0 auto;top: 100px;" id="message">
            ${message}
        </div>
        <script>
            setTimeout(function(){
                document.getElementById("message").style.display="none";
            },3000);
        </script>
    </#if>
    <div class="row">
        <div class="col">
            <form method="post" enctype="multipart/form-data" action="${request.contextPath}/page/upload">
                <div class="mb-3">
                    <label for="fileInput" class="form-label">文件上传</label>
                    <input type="file" class="form-control" id="fileInput" aria-describedby="fileHelp" name="file">
                    <div id="fileHelp" class="form-text">支持word，excel，ppt，pdf，图片，视频，音频，markdown等格式文件的在线预览</div>
                </div>
                <button type="submit" class="btn btn-primary">提交</button>
            </form>
        </div>
    </div>
    <div class="row">
        <div class="col">
            <iframe src="${request.contextPath}/file/preview/list" width="100%" height="800px"></iframe>
        </div>
    </div>
</div>
</body>
</html>